﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true"
    CodeBehind="edit.aspx.cs" Inherits="Maticsoft.Web.Admin.Sys.edit" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
       $(function () {
           $("#chk_all").click(function () {
               $("input[name=chk_list]").each(function () {
                   $(this).attr("checked", true);
               })
           });
           $("#chk_no").click(function () {
               $("input[name=chk_list]").each(function () {
                   $(this).attr("checked", false);
               })
           })
       })
       function Chk() {
           var ids = "";
           $("#lists input:checkbox").each(function () {
               if ($(this).attr("checked") == true) {
                   if (ids.length > 0) {
                       ids += ",";
                   }
                   ids += $(this).val();
               }
           })
           if (ids.length > 0) {
               $("#ctl00_ContentPlaceHolder1_txtIds").val(ids);
               return true;
           }
           else {
               alert("请选择权限");
               return false;
           }
       }
       </script>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111"
        style="border-collapse: collapse">
        <tr>
            <td width="100%" height="20" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td height="30">
                            <img height="14" src="../images/book1.gif" width="20">&nbsp;权限管理&nbsp;&gt;&gt;&nbsp;添加/修改
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td width="100%" height="1" background="../images/sp_bg.gif">
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="10">
            </td>
        </tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td height="95" align="center" bgcolor="#FFFFFF">
                <table width="100%" border="0" id="needset" cellspacing="0" cellpadding="0" style="text-align: left;
                    border: 1px solid #cfcfcf; background: #ffffff;">
                    <tr>
                        <td width="150" class='bline' height="26" style="padding-left: 10px;">
                            管理员名：
                        </td>
                        <td class='bline'>
                            <asp:TextBox ID="txtUserName" runat="server" Width="200px"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                ID="RequiredFieldValidator1" runat="server" ErrorMessage="管理员名不能为空" ControlToValidate="txtUserName"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td width="150" class='bline' height="26" style="padding-left: 10px;">
                            密码：
                        </td>
                        <td class='bline'>
                            <asp:TextBox ID="txtPassword" runat="server" Width="200px" TextMode="Password"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                ID="RequiredFieldValidator4" runat="server" ErrorMessage="密码不能为空" ControlToValidate="txtPassword"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class='bline' height="26" style="padding-left: 10px;">
                            确认密码：
                        </td>
                        <td class='bline'>
                            <asp:TextBox ID="txtPassword1" runat="server" Width="200px" TextMode="Password"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                ID="RequiredFieldValidator2" runat="server" ErrorMessage="确认密码不能为空" ControlToValidate="txtPassword1"
                                Display="Dynamic"></asp:RequiredFieldValidator>
                            <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPassword"
                                ControlToValidate="txtPassword1" ErrorMessage="密码输入不一致" Display="Dynamic"></asp:CompareValidator>
                        </td>
                    </tr>
                    <tr>
                        <td class='bline' height="26" style="padding-left: 10px;">
                            级别：
                        </td>
                        <td class='bline'>
                            <asp:DropDownList ID="ddlGroup" runat="server">
                                <asp:ListItem Value="2">管理员</asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class='bline' height="26" style="padding-left: 10px;">
                            邮箱：
                        </td>
                        <td class='bline'>
                            <asp:TextBox ID="txtEmail" runat="server" Width="200px"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                ID="RequiredFieldValidator3" runat="server" ErrorMessage="邮箱不能为空" ControlToValidate="txtEmail"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                    <tr>
                        <td height="26" style="padding-left: 10px;">
                            电话：
                        </td>
                        <td>
                            <asp:TextBox ID="txtPhone" runat="server" Width="200px"></asp:TextBox>&nbsp;<asp:RequiredFieldValidator
                                ID="RequiredFieldValidator5" runat="server" ErrorMessage="电话不能为空" ControlToValidate="txtPhone"></asp:RequiredFieldValidator>
                        </td>
                    </tr>
                </table>
                <table width="100%" border="0" cellpadding="2" cellspacing="1" bgcolor="#CFCFCF" align="center"
                    style="margin-top: 8px" id="lists">
                    <tr bgcolor="#E7E7E7">
                        <td height="28" colspan="3" background="../images/tbg.gif" style="padding-left: 10px;">
                            设置权限
                        </td>
                    </tr>
                    <tr align="center" bgcolor="#FBFCE2" height="25">
                        <td width="4%">
                            编号
                        </td>
                        <td width="10%">
                            模块
                        </td>
                        <td>
                            操作
                        </td>
                    </tr>
                    <asp:Repeater ID="Repeater1" runat="server">
                        <ItemTemplate>
                            <tr align='center' bgcolor="#FFFFFF" height="26" align="center" onmousemove="javascript:this.bgColor='#FCFDEE';"
                                onmouseout="javascript:this.bgColor='#FFFFFF';">
                                <td>
                                    <%#Eval("ModuleId") %>
                                </td>
                                <td>
                                    <%#Eval("ModuleName") %>
                                </td>
                                <td align='left'>
                                    <input name="chk_list" type="checkbox" id="read" class="np" value="<%#Eval("ModuleId")+"/"+Eval("ModuleCode")+"/read" %>" <%#hasPermission(Eval("ModuleId").ToString(),Eval("ModuleCode").ToString(),"read")==true ? "checked" : "" %> />阅览 <input name="chk_list" type="checkbox" id="modify" class="np" value="<%#Eval("ModuleId")+"/"+Eval("ModuleCode")+"/modify" %>" <%#hasPermission(Eval("ModuleId").ToString(),Eval("ModuleCode").ToString(),"modify")==true ? "checked" : "" %> />修改 <input name="chk_list" type="checkbox" id="del" class="np" value="<%#Eval("ModuleId")+"/"+Eval("ModuleCode")+"/del" %>" <%#hasPermission(Eval("ModuleId").ToString(),Eval("ModuleCode").ToString(),"del")==true ? "checked" : "" %> />删除
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr bgcolor="#ffffff">
                        <td height="36" colspan="3">
                            &nbsp; <a href="javascript:void(0);" id="chk_all" class="coolbg">全选</a> <a href="javascript:void(0);"
                                class="coolbg" id="chk_no">取消</a>
                            <input id="txtIds" type="text" runat="server"
                                    style="display: none" />
                        </td>
                    </tr>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#F9FCEF"
                    style="border: 1px solid #cfcfcf; border-top: none;">
                    <tr>
                        <td width="1%" height="35">
                        </td>
                        <td width="99%" valign="bottom">
                            <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="../images/button_ok.gif"
                                class="np" OnClick="ImageButton1_Click" OnClientClick="return Chk();" />&nbsp;&nbsp;<a href="list.aspx"><img src="../images/button_back.gif"
                                    width="60" height="22" border="0" /></a>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
